
<template>
  <div class="wrapper">
    <swiper :options="swiperOption" v-if="swiperList.length">
      <swiper-slide  v-for="iteam of swiperList" :key="iteam.id">
        <img :src="iteam.imgUrl" class="swiper-img">
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>

export default {
  name: 'HomeSwiper',
  props: {
    list: Array
  }, 
  data() {
    return {
      swiperOption: {
        pagination: ".swiper-pagination",
        // autoplay: {
        //   // delay: 3000,
        //   stopOnLastSlide: false,
        //   disableOnInteraction: false
        // },
        speed: 300,
        loop: true,
        autoplay:3000,
        disableOnInteraction: false,
        stopOnLastSlide: false
      },
      swiperList: this.list
    }
  },
  watch:{
    list:function(n){
      this.swiperList = n
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet-active
    background: #fff
  .wrapper
    overflow: hidden
    height: 0
    width: 100%
    padding-bottom: 31%
    background: #eee
    .swiper-img
      width: 100%
</style>
